﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace SnakeGame.Converters
{
    class AnswerConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is int)
            {
                int a = (int)value;

                if (a != 999)
                {
                    if (a == 0)
                    {
                        return "Stay here";
                    }
                    else if (a > 0)
                    {
                        return "Move " + a.ToString();
                    }
                    else
                    {
                        return "Move back " + Math.Abs(a).ToString();
                    }
                }
                else
                {
                    return "Retoss again";
                }
            }
            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
